package example.time;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by lenovo on 2016/11/4 0004.
 */
public class TimeMillis {
    public static void main(String[] args) {
        long timeStamp = System.currentTimeMillis();  //获取当前时间戳
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String sd = sdf.format(new Date(Long.parseLong(String.valueOf(timeStamp))));   // 时间戳转换成时间
        System.out.println(sd);
    }
}
